|
Precedence Level
|
Symbol
|
Description
|
Associativity
|
|
1
|
::
|
C++ scope access/resolution
|
Left to right
|
|
2
|
()
|
Function call
|
Left to right
|
|
[]
|
Array subscript
|
|
|
->
|
Visual C++ indirect component selector
|
|
|
.
|
C++ direct component selector
|
|
|
3
|
|
|
|
|
Unary
|
!
|
Logical negation
|
Right to left
|
|
~
|
Bitwise (1's) complement
|
|
|
+
|
Unary plus
|
|
|
-
|
Unary minus
|
|
|
&
|
Address of
|
|
|
*
|
Indirection
|
|
|
sizeof
|
Returns size of operand in bytes
|
|
|
new
|
Dynamically allocates C++ storage
|
|
|
delete
|
Dynamically deallocates C++ storage
|
|
|
type
|
Typecast
|
|
|
4
|
|
|
|
|
|
|
|
|
Member Access
|
.*
|
C++ dereference
|
Left to right
|
|
->*
|
C++ dereference
|
|
|
()
|
Expression parentheses
|
|
|
5
|
|
|
|
|
Multiplicative
|
*
|
Multiply
|
Left to right
|
|
/
|
Divide
|
|
|
%
|
Remainder (modulus)
|
|
|
6
|
|
|
|
|
Additive
|
+
|
Binary plus
|
Left to right
|
|
-
|
Binary minus
|
|
|
7
|
|
|
|
|
Shift
|
<<
|
Leftshift
|
Left to right
|
|
>>
|
Rightshift
|
|
|
8
|
|
|
|
|
Relational
|
<
|
Less than
|
Left to right
|
|
<=
|
Less than or equal to
|
|
|
>
|
Greater than
|
|
|
>=
|
Greater than or equal to
|
|
|
9
|
|
|
|
|
Equality
|
==
|
Equal to
|
Left to right
|
|
!=
|
Not equal to
|
|
|
10
|
&
|
Bitwise AND
|
Left to right
|
|
11
|
^
|
Bitwise XOR
|
Left to right
|
|
12
|
|
|
Bitwise OR
|
Left to right
|
|
13
|
&&
|
Logical AND
|
Left to right
|
|
14
|
||
|
Logical OR
|
Left to right
|
|
15
|
|
|
|
|
Ternary
|
?:
|
Conditional
|
Right to left
|
|
16
|
|
|
|
|
Assignment
|
=
|
Simple assignment
|
Right to left
|
|
*=
|
Compound assign product
|
|
|
/=
|
Compound assign quotient
|
|
|
%=
|
Compound assign remainder
|
|
|
+=
|
Compound assign sum
|
|
|
-=
|
Compound assign difference
|
|
|
&=
|
Compound assign bitwise AND
|
|
|
^=
|
Compound assign bitwise XOR
|
|
|
|=
|
Compound assign bitwise OR
|
|
|
<<=
|
Compound assign left shift
|
|
|
>>=
|
Compound assign right shift
|
|
|
17
|
|
|
|
|
Comma
|
,
|
Sequence point
|
Left to right |